import { createSlice } from '@reduxjs/toolkit'

export const listSlice = createSlice({
	name: 'list',
	initialState: {
		list:[]
	},
	reducers: {
		getlist(state,action) {
			state.list=action.textlist
		},
	},
})

// const textlistState={
// 	list:[]
// }
// const textReducer = (state = textlistState, action) => {
// 	switch (action.type) {
// 		case "getlist":
// 			return { ...state, list: state.list = action.textlist }
// 		default:
// 			return { ...state }
// 	}
// }
export const { getlist } = listSlice.actions
export default listSlice.reducer
